﻿using Inovout.Cloud.Applications.Security.Models;
using Inovout.Services;
using NHibernate.Criterion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inovout.Cloud.Applications.Security.Services
{
    public class SymmetricCryptoKeyService : RepositoryService<SymmetricCryptoKey>
    {
        public IList<SymmetricCryptoKey> FindByBucketAndHandle(string bucket,string handle)
        {
            return Repository.FindAll(Restrictions.Eq("Bucket", bucket), Restrictions.Eq("Handle",handle));
        }

        public void Delete(string bucket, string handle)
        {
            throw new NotImplementedException();
        }

        public IList<SymmetricCryptoKey> FindByBucket(string bucket)
        {
            return Repository.FindAll(Restrictions.Eq("Bucket", bucket));
        }
    }
}
